from sklearn.preprocessing import PolynomialFeatures
import numpy as np

x=np.arange(1,10).reshape(3,3)
print(x)
#degree：最高次幂
pl=PolynomialFeatures(degree=2)
x_poly1=pl.fit_transform(x)
print(x_poly1)
#INCLUDE_BIAS:偏置项
pl=PolynomialFeatures(degree=2,include_bias=False)
x_poly1=pl.fit_transform(x)
print(x_poly1)
#没有最高次幂了
pl=PolynomialFeatures(degree=2,interaction_only=True)
x_poly1=pl.fit_transform(x)
print(x_poly1)